@{
    ViewBag.Title = "用户登陆日志";
}
@section head{
   <script type="text/javascript">
       $(document).ready(function () {
           $('.btnSearch').click(function () {
               mainSearch('.search_box :input');
           });

           $('#LoginStatus').combobox({
               onChange: function (f, a) {
                   $('.btnSearch').click();
               }
           });
       });
       function onDeleteData() {
           $('#details').datagrid('reload');
       }
       function cmdformat(value, row, index) {
           return '<a href="javascript:Del(\'' + row.ID + '\',onDeleteData)">删除</a>';
       }
       var loginStatus=@Html.Raw(new OA.Mvc3.Controllers.DictionaryController().GetChilds("LoginStatus"));
       
       function statusformat(value, row, index) {
          return dicformat(loginStatus,value);
       }
   </script>
}
@section body{ 
<body style="padding:@ViewBag.Padding">
<div class="easyui-layout" data-options="fit:true">
    <div region="north" border="false">
        <div class="navigation">@ViewBag.CurrentPath</div>
        <div class="tools_box">
	        <div class="tools_bar">
                <div class="left">
                   <a href="javascript:search_click();" id="search" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true ">查询</a>  
                   <a href="javascript:DeleteSelecteds($('#details').datagrid('getSelections'),'ID',onDeleteData)" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">批量删除</a>
                </div>
            </div>
            <div class="search_box">
                状态：<select id="LoginStatus" name="LoginStatus" data-options="panelHeight:'auto'" >  
                    @Html.Raw(OA.UI.Controls.SelectByDictionary("LoginStatus", null, true))
                </select>
			    用户名：<input type="text" name="UserName" class="txtSearchInput" />
                IP：<input type="text" name="LoginIP" class="txtSearchInput" />
                <input type="submit" value="查询" class="btnSearch"/>
		    </div>
        </div>
    </div> 
    <div region="center" border="false">
        <table class="easyui-datagrid" id="details" data-options="fit:true,rownumbers:true,singleSelect:false,
          pagination:true,border:true,url:serverUrl.list">
           <thead data-options="frozen:true"> 
              <tr>
                   <th data-options="field:'id',checkbox:true"></th>
                   <th data-options="field:'UserName',sortable:true,width:100">用户名</th>
              </tr>
           </thead>
           <thead>  
               <tr>  
                   <th data-options="field:'RealName',width:120">姓名</th>
                   <th data-options="field:'LoginIP',sortable:true,width:120">登陆IP</th>
                   <th data-options="field:'LoginTime',sortable:true,width:150">登陆时间</th>
                   <th data-options="field:'LoginStatus',sortable:true,width:150,formatter:statusformat">登陆状态</th>
                   <th data-options="field:'cmd',width:100,align:'center',formatter:cmdformat">操作</th>
               </tr>  
           </thead>  
        </table>
    </div>
</div>
</body>
}